<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreatePersonasTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    
                    <h:outputLabel value="#{bundle.CreatePersonasLabel_nombre}" for="Nombre" />
                    <h:inputText id="nombre" value="#{personasController.selected.nombre}" title="#{bundle.CreatePersonasTitle_nombre}" required="true" requiredMessage="#{bundle.CreatePersonasRequiredMessage_nombre}"/>
                    
                    <h:outputLabel value="#{bundle.CreatePersonasLabel_ci}" for="CI" />
                    <h:inputText id="ci" value="#{personasController.selected.ci}" title="#{bundle.CreatePersonasTitle_ci}" />
                    
                    <h:outputLabel value="#{bundle.CreatePersonasLabel_email}" for="Email" />
                    <h:inputText id="email" value="#{personasController.selected.email}" title="#{bundle.CreatePersonasTitle_email}" />
                    
                    <h:outputLabel value="#{bundle.CreatePersonasLabel_direccion}" for="Dirección" />
                    <h:inputText id="direccion" value="#{personasController.selected.direccion}" title="#{bundle.CreatePersonasTitle_direccion}" />
                    
                    <h:outputLabel value="#{bundle.CreatePersonasLabel_telefono}" for="Telefono" />
                    <h:inputText id="telefono" value="#{personasController.selected.telefono}" title="#{bundle.CreatePersonasTitle_telefono}" />
                    
                    <h:outputLabel value="#{bundle.CreatePersonasLabel_nombreusuario}" for="Nombre de usuario" />
                    <h:inputText id="nombreusuario" value="#{personasController.selected.nombreusuario}" title="#{bundle.CreatePersonasTitle_nombreusuario}" required="true" requiredMessage="#{bundle.CreatePersonasRequiredMessage_nombreusuario}"/>
                    
                    <h:outputLabel value="#{bundle.CreatePersonasLabel_contrasena}" for="Contraseña" />
                    <h:inputText id="contrasena" value="#{personasController.selected.contrasena}" title="#{bundle.CreatePersonasTitle_contrasena}" required="true" requiredMessage="#{bundle.CreatePersonasRequiredMessage_contrasena}"/>
                    
                    <h:outputLabel value="#{bundle.CreatePersonasLabel_rol}" for="Rol" />
                    <h:selectOneMenu id="rol" value="#{personasController.selected.rol}" title="#{bundle.CreatePersonasTitle_rol}" required="true" requiredMessage="#{bundle.CreatePersonasRequiredMessage_rol}">
                        <f:selectItems value="#{rolController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>

                </h:panelGrid>
                <br />
                <h:commandLink action="#{personasController.create}" value="#{bundle.CreatePersonasSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{personasController.prepareList}" value="#{bundle.CreatePersonasShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.CreatePersonasIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
